﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;

namespace WarehouseManagement.DataAccess
{

    public partial class ImportDetail
    {
        public void Detach()
        {
            GetType().GetMethod("Initialize", BindingFlags.Instance |
               BindingFlags.NonPublic).Invoke(this, null);
        }
    }

    public static class DetachExtensions
    {
        public static void Detach(this INotifyPropertyChanged obj)
        {
            obj.GetType().GetMethod("Initialize", BindingFlags.Instance |
                          BindingFlags.NonPublic).Invoke(obj, null);
        }
    }
}
